package com.jyw.business.knowledge.service.impl;

import java.util.List;
import com.jyw.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.jyw.business.knowledge.mapper.KlKnowledgeMapper;
import com.jyw.business.knowledge.domain.KlKnowledge;
import com.jyw.business.knowledge.service.IKlKnowledgeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;

/**
 * 知识库-信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-17
 */
@Service
public class KlKnowledgeServiceImpl extends ServiceImpl<KlKnowledgeMapper,KlKnowledge> implements IKlKnowledgeService
{
    @Resource
    private KlKnowledgeMapper klKnowledgeMapper;

    /**
     * 查询知识库-信息
     * 
     * @param id 知识库-信息主键
     * @return 知识库-信息
     */
    @Override
    public KlKnowledge selectKlKnowledgeById(Long id)
    {
        return klKnowledgeMapper.selectKlKnowledgeById(id);
    }

    /**
     * 查询知识库-信息列表
     * 
     * @param klKnowledge 知识库-信息
     * @return 知识库-信息
     */
    @Override
    public List<KlKnowledge> selectKlKnowledgeList(KlKnowledge klKnowledge)
    {
        return klKnowledgeMapper.selectKlKnowledgeList(klKnowledge);
    }

    /**
     * 新增知识库-信息
     * 
     * @param klKnowledge 知识库-信息
     * @return 结果
     */
    @Override
    public int insertKlKnowledge(KlKnowledge klKnowledge)
    {
        klKnowledge.setCreateTime(DateUtils.getNowDate());
        return klKnowledgeMapper.insertKlKnowledge(klKnowledge);
    }

    /**
     * 修改知识库-信息
     * 
     * @param klKnowledge 知识库-信息
     * @return 结果
     */
    @Override
    public int updateKlKnowledge(KlKnowledge klKnowledge)
    {
        klKnowledge.setUpdateTime(DateUtils.getNowDate());
        return klKnowledgeMapper.updateKlKnowledge(klKnowledge);
    }

    /**
     * 批量删除知识库-信息
     * 
     * @param ids 需要删除的知识库-信息主键
     * @return 结果
     */
    @Override
    public int deleteKlKnowledgeByIds(Long[] ids)
    {
        return klKnowledgeMapper.deleteKlKnowledgeByIds(ids);
    }

    /**
     * 删除知识库-信息信息
     * 
     * @param id 知识库-信息主键
     * @return 结果
     */
    @Override
    public int deleteKlKnowledgeById(Long id)
    {
        return klKnowledgeMapper.deleteKlKnowledgeById(id);
    }
}
